package com.zhl.constructor;

public class Test {
    public static void main(String[] args) {
        //目的：认识构造器,并掌握构造器的特点，应用场景，注意事项
        //默认调用构造无参数构造器
        Student s1 = new Student();
        //调用有参数构造器
        Student s2 = new Student("张三", 20);

        System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        Student s3 = new Student("张三",78);
        System.out.println(s3.name);
        System.out.println(s3.score);

    }
}
